package com.eya.rabbitmq.provider;

import com.eya.rabbitmq.config.RabbitConfigure;

import org.springframework.amqp.core.AmqpTemplate;
import org.springframework.stereotype.Component;

import javax.annotation.Resource;

/**
 * topic消息生产者
 *
 * @auther: luolin
 * @since: 2018/11/19 14:35
 */
@Component
public class TopicMessageProvider {

	@Resource
	private AmqpTemplate amqpTemplate;

	public void send(String topic, String content) {
		amqpTemplate.convertAndSend(RabbitConfigure.SPRING_BOOT_EXCHANGE, topic, content);
	}

}
